package com.cloudpolice.equipment.service.Impl;

import com.cloudpolice.equipment.dao.EquipmentSiteMapper;
import com.cloudpolice.equipment.model.EquipmentSiteModel;
import com.cloudpolice.equipment.service.EquipmentSiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：梁昊，后端工程师：卢春龙，前端工程师：孙耀
 * @create 2020-04-21 14:04
 * @function
 * @editLog
 */
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Service
public class EquipmentSiteServiceImpl implements EquipmentSiteService {
    @Autowired
    EquipmentSiteMapper equipmentSiteMapper;

    /**
     * 根据sn号删除位置关系
     *
     * @param sn
     * @return 结果
     */
    @Override
    public int deleteEquipmentSiteBySn (String sn) {
        return equipmentSiteMapper.deleteEquipmentSiteBySn(sn);
    }


    /**
     * 新增设备位置关系
     *
     * @param equipmentSiteModel com.cloudpolice.equipment.model.InPutParam.EquipmentSiteModel
     * @return 结果
     */
    @Override
    public int insertEquipmentSite (EquipmentSiteModel equipmentSiteModel) {
        return equipmentSiteMapper.insertEquipmentSite(equipmentSiteModel);
    }

    /**
     * 新增设备位置关系
     *
     * @param sn
     * @return 结果
     */
    @Override
    public int insertEquipmentSiteBeforeCheck(String sn) {
        return equipmentSiteMapper.insertEquipmentSiteBeforeCheck(sn);
    }


    /**
     * 修改设备位置关系
     *
     * @param equipmentSiteModel com.cloudpolice.equipment.model.InPutParam.EquipmentSiteModel
     * @return 结果
     */
    @Override
    public int updateEquipmentSite (EquipmentSiteModel equipmentSiteModel) {
        return equipmentSiteMapper.updateEquipmentSite(equipmentSiteModel);
    }

    /**
     * 通用查询设备位置关系
     *
     * @param equipmentSiteModel 通用查询设备位置关系
     * @return 结果
     */
    @Override
    public List<EquipmentSiteModel> getEquipmentSite(EquipmentSiteModel equipmentSiteModel) {
        return equipmentSiteMapper.getEquipmentSite(equipmentSiteModel);
    }

}

